package com.itheima.day04;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Demo2 {
    public static void main(String[] args) {
        Date date=new Date();
        System.out.println(date);

        //"yyyy-MM-dd HH:mm:ss"
        SimpleDateFormat sdf=new SimpleDateFormat();

        long time = date.getTime();
//        String format = sdf.format(date);
        String format = sdf.format(time);
        System.out.println(format);
    }
}
